<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Vue component test</title>
    <script src="../js/vue.js"></script>
</head>
<body>

<div id="c-d">
    <button-counter ta="我的测试"></button-counter>
    <custom-input v-model="searchText"></custom-input>
</div>


<script type="text/javascript">
    //定义全局组件
    Vue.component('button-counter', {
        data: function () {
            return {
                count: 0
            }
        },
        props:['ta'],
        template: '<button v-on:click="count++"> you clicked me {{count}} times.{{ta}}</button>'
    });
    

</script>

</body>
</html>